const res = {
   code: 200,
   all: {
      name: '全部歌单',
      resourceCount: 1000,
      imgId: 0,
      imgUrl: null,
      type: 0,
      category: 4,
      resourceType: 0,
      hot: false,
      activity: false,
   },
   sub: [
      {
         name: '综艺',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 4,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '流行',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 1,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '影视原声',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 4,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '华语',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 0,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '清晨',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '怀旧',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 3,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '夜晚',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 2,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '摇滚',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 1,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '欧美',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 0,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '清新',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 3,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: 'ACG',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 4,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '浪漫',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '民谣',
         resourceCount: 531,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 1,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '日语',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 0,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '学习',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 2,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '儿童',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '电子',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 1,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '韩语',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 0,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '校园',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '工作',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '午休',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '伤感',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '粤语',
         resourceCount: 247,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 0,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '游戏',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '舞曲',
         resourceCount: 298,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '说唱',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '70后',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '治愈',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 3,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '下午茶',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '放松',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '轻音乐',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 1,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '80后',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '地铁',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '90后',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '孤独',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '驾车',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '爵士',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '感动',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '乡村',
         resourceCount: 280,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '网络歌曲',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '运动',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 0,
         category: 2,
         resourceType: 0,
         hot: true,
         activity: false,
      },
      {
         name: '兴奋',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: 'KTV',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: 'R&B/Soul',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '旅行',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '古典',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '快乐',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '经典',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '散步',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '民族',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '翻唱',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '酒吧',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 2,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '安静',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '吉他',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '英伦',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '思念',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 3,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '金属',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '钢琴',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '器乐',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '蓝调',
         resourceCount: 220,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '榜单',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '00后',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 4,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '雷鬼',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '世界音乐',
         resourceCount: 962,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '拉丁',
         resourceCount: 379,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: 'New Age',
         resourceCount: 688,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: '古风',
         resourceCount: 563,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
      {
         name: 'Bossa Nova',
         resourceCount: 1000,
         imgId: 0,
         imgUrl: null,
         type: 1,
         category: 1,
         resourceType: 0,
         hot: false,
         activity: false,
      },
   ],
   categories: { 0: '语种', 1: '风格', 2: '场景', 3: '情感', 4: '主题' },
};
export function _generateObj(res) {
   let { categories, sub } = res;
   let newObj = {};
   for (let item in categories) {
      newObj[item] = [];
   }
   sub.forEach(element => {
      switch (element.category) {
         case 0:
            newObj[0].push(element);
            break;
         case 1:
            newObj[1].push(element);
            break;
         case 2:
            newObj[2].push(element);
            break;
         case 3:
            newObj[3].push(element);
            break;
         case 4:
            newObj[4].push(element);
            break;
      }
   });
   return newObj;
}
